package org.zjvis.datascience.common.widget.vo;

import lombok.Data;
import org.zjvis.datascience.common.vo.PageVO;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @description widgt信息请求的父类
 * @date 2022-06-22
 */
@Data
public class WidgetRequestBaseVO extends PageVO {

    private Long projectId;

    @NotEmpty(message = "tableName cannot be null")
    public String tableName;

    @NotNull(message = "taskId or datasetId cannot be empty")
    public Long dataId;

    @NotNull(message = "please specify node type, task || dataset")
    private String startNodeType;

    public boolean isFromTask() {
        return this.getStartNodeType().equals("task");
    }
}
